Fix rmw_fastrtps SHM crash on Windows with secured large messages (Issue #561) - #605
Fix rmw_fastrtps SHM crash on Windows with secured large messages (Issue #561)#605Aaravanand00 wants to merge 1 commit into
Conversation
On Windows, FastDDS uses Shared Memory (SHM) transport by default for intra-host communication. When DDS-Security is enabled, the security overhead can cause the SHM segment to overflow when sending large messages (e.g. UnboundedSequences), resulting in an Access Violation crash (exit code 0xC0000005) in the publisher process. Fix by supplying a FastDDS XML profile (fastdds_no_shm.xml) that disables SHM and forces UDPv4 with enlarged send/receive buffers. The profile is injected via FASTRTPS_DEFAULT_PROFILES_FILE only on WIN32 and only for rmw_fastrtps_cpp / rmw_fastrtps_dynamic_cpp, so there is zero behavioural change on Linux or macOS. Fixes ros2#561 Signed-off-by: Aaravanand <aaravanand@gmail.com>
|
Tick the box to add this pull request to the merge queue (same as
|
|
Hi @fujitatomoya looking into issue #561 the publisher was crashing on Windows (exit code 0xC0000005) because FastDDS's default Shared Memory transport overflows when handling large encrypted messages. Fixed it by injecting a FastDDS XML profile that switches to UDP transport only applies on Windows, no tests skipped, Linux/macOS completely unaffected. Please let me know if any changes was needed.... |
|
@fujitatomoya ptal |
fujitatomoya
left a comment
There was a problem hiding this comment.
@Aaravanand00 thanks for creating PR.
a couple of comments and did you actually reproduce the issue on windows and check if this PR addresses the issue?
CC: @MiguelCompany
| # platforms so no behaviour change occurs there. (Issue #561) | ||
| set(FASTDDS_PROFILES_FILE "") | ||
| if(WIN32) | ||
| file(TO_NATIVE_PATH |
There was a problem hiding this comment.
does this generate the backslashes? and eventually FASTRTPS_DEFAULT_PROFILES_FILE points at a garbage path and FastDDS silently keeps using SHM?
| @@ -0,0 +1,33 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
There was a problem hiding this comment.
do we even need this configuration xml file at all? FASTDDS_BUILTIN_TRANSPORTS=UDPv4 does the same work instead? if it does, it can be much simpler though.
There was a problem hiding this comment.
I fully agree with this. Using FASTDDS_BUILTIN_TRANSPORTS=UDPv4 would be easier than using an XML configuration.
|
I'd like to note that issue #561 is another instance of Windows process killed with If we make every run of a test involving a Fast DDS rmw call |
Description
On Windows, FastDDS uses Shared Memory (SHM) transport by default for intra-host communication. When DDS-Security is enabled, the security overhead causes the SHM segment to overflow when sending large messages (e.g.
UnboundedSequences), resulting in an Access Violation crash (0xC0000005) in the publisher process. Since the publisher crashes, the subscriber waits indefinitely and the test times out.This PR fixes the crash by supplying a FastDDS XML profile (
fastdds_no_shm.xml) that disables SHM and forces UDPv4 transport with enlarged send/receive buffers (1 MB) to accommodate the security-layer overhead on large messages.Key changes :-
test_security_files/fastdds_no_shm.xml: FastDDS profile that disables built-in SHM and uses only UDPv4 transport.test_secure_publisher_subscriber.py.in: InjectsFASTRTPS_DEFAULT_PROFILES_FILEenv var forrmw_fastrtps_cpp/rmw_fastrtps_dynamic_cppprocesses.CMakeLists.txt: Computes the native path to the XML profile onWIN32; set to empty string on Linux/macOS so there is zero behavioural change on non-Windows platforms.Fixes #561
Is this user-facing behavior change?
No. This is a test infrastructure fix. The actual security tests remain unchanged no tests are skipped or removed.
Did you use Generative AI?
Yes, Ai Agent was used to assist in root cause analysis and implementation.
Additional Information
The fix applies only when
WIN32is defined at CMake configure time, so Linux and macOS CI is completely unaffected.